package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.po.MarketCategory;
import com.cskaoyan.bean.wx.category.WxCatalogCurrentVo;
import com.cskaoyan.bean.wx.category.WxCatelogIndexVo;
import com.cskaoyan.mapper.MarketCategoryMapper;
import com.cskaoyan.service.wx.WxCatelogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {

    @Autowired
    WxCatelogService wxCatelogService;

    @GetMapping("index")
    public BaseRespVo index(){

        WxCatelogIndexVo wxCatelogIndexVo = wxCatelogService.queryAll();

        return BaseRespVo.ok(wxCatelogIndexVo);

    }

    @GetMapping("current")
    public BaseRespVo current(Integer id){

        WxCatalogCurrentVo wxCatalogCurrentVo = wxCatelogService.queryAllById(id);

        return BaseRespVo.ok(wxCatalogCurrentVo);

    }


}
